<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>04_流程控制</title>
</head>
<body>
<script>
    console.log('1');
    console.log('2');
    console.log('3');

    let uname='';
    if(!uname){
       /* alert('请输入用户名');
        console.log('请输入用户名');*/
    }else{
        /*alert('欢迎您:'+uname);
        console.log('欢迎您:'+uname);*/
    }

    let gender=1;
    switch ( gender){
        case 1:
            console.log('你是一个男生');
            break;
        case 0:
            console.log('你是一个女生');
            break;
        default:
            console.log('你是一个未知性别');
            break;
    }

    let names = ['小王','小李','小张'];
    for(var i=0;i<names.length;i++){
        console.log(names[i]);
    }
    console.log('循环结束');
    console.log(i);

for(let n of names){
    console.log(n);
}




</script>
</body>
</html>